<script>
    layui.config({
        base: '/static/customAdmin/'
    }).extend({
        index: 'lib/index'
    }).use(['index', 'form', 'admin'], function () {
        const admin = layui.admin , form = layui.form;
        form.on('submit(clearance_submit)', async (data) => {
            const clearance_new = await admin.post(@{{ urlfor "ClearanceController.Store" }}, data.field);
            if(clearance_new.status) {
                const index = parent.layer.getFrameIndex(window.name);
                setTimeout(() => {
                    admin.reloadFrame("权限管理iframe");
                    parent.layui.table.reload('clearance_lists');
                    parent.layer.close(index);
                }, 2000);
            }
        })
    });
</script>